﻿@{
    ViewBag.Title = "Quản lý quận/huyện";
    Layout = "~/Views/Shared/_Layout.Management.cshtml";
}

<h2 class="app">
	<strong>Express - Quản lý quận/huyện</strong>
</h2>
<div class="title">
    <span class="right-btns">
        <input id="searchKeyword" type="text" class="text spl search filter" style="margin-top: -1px;" data-bind="value: Keywords, event: { keypress: RunSomethingKey }" />
        <a href="#" class="btn btn-go" data-bind="click: SearchButton">Go</a>
        <span class="v-line"></span>
        <a href="/Management/DistrictList/Add">Thêm mới &raquo;</a>
    </span>
    <h3>Xem quận/huyện</h3>
</div>
<span class="paging">
    <span class="pageleft">
        <span class="total" data-bind='text: PageText'></span>
        <span class="show">Hiển thị <input type="text" class="text" data-bind="value: PageSize" onkeypress="return isNumberKey(event)" /> trên trang</span>
    </span>
    <span class="pages">Trang <input type="text" class="text" data-bind="value: CurrentPageIndex" onkeypress="return isNumberKey(event)" /> của <span data-bind="text: maxPageIndex"></span>
    <a href="##" class="btn btn-prev-arrow" data-bind="click: PrevButton, attr: {'class': PrevButtonClass}"></a>                            
    <a href="##" class="btn btn-next-arrow" data-bind="click: NextButton, attr: {'class': NextButtonClass}"></a>
    </span>
</span>
<div class="table table-leads managedistricts">
	<div class="title">
		<div class="col1">
            <span class="w">
                <a href="#" data-bind='click: function(event) { SetOrder(event, "Name")}'>Tên quận/huyện</a>
                <div class="sort_wrapper" id="Name">  
                    <span class="grid_order ui_icon"></span>
                </div>               
            </span>
        </div>
		<div class="col1 col2">
            <span class="w">
                <a href="#" data-bind='click: function(event) { SetOrder(event, "StateName")}'>Tỉnh/thành phố</a>
                <div class="sort_wrapper" id="StateName">  
                    <span class="grid_order ui_icon"></span>
                </div>               
            </span>
        </div>
		<div class="col1 col3">
            <span class="w">
                <a href="#" data-bind='click: function(event) { SetOrder(event, "StateName")}'>Mã</a>
                <div class="sort_wrapper" id="StateId">  
                    <span class="grid_order ui_icon"></span>
                </div>               
            </span>
        </div>
        <div class="col1 col4">
            <span class="w">
                <a href="#" data-bind='click: function(event) { SetOrder(event, "Ordered")}'>Thứ tự</a>
                <div class="sort_wrapper" id="Ordered">  
                    <span class="grid_order ui_icon"></span>
                </div>               
            </span>
        </div>
        <div class="col1 col5">
            <span class="w">
                <a href="#" data-bind='click: function(event) { SetOrder(event, "DateCreated")}'>Ngày tạo</a>
                <div class="sort_wrapper" id="DateCreated">  
                    <span class="grid_order ui_icon"></span>
                </div>               
            </span>
        </div>
        <div class="col1 col6 centeralign">
            <span class="w">
                <a href="#" data-bind='click: function(event) { SetOrder(event, "Active")}'>Tình trạng</a>
                <div class="sort_wrapper" id="Active">  
                    <span class="grid_order ui_icon"></span>
                </div>               
            </span>
        </div>
		<div class="col1 col12 centeralign"><span class="w">Xóa</span></div>
	</div>
    <div class="linegroup" data-bind="foreach: ItemsOnPage">
        <div class="line">
		    <div class="col1">
                <span class="w" style="font-weight:bold">
                    <a data-bind='text: Name, attr: {href: "/Management/DistrictList/Edit/" + ID}'>Edit</a>
                </span>
            </div>
		    <div class="col1 col2"><span class="w" data-bind='text: StateName'></span></div>
		    <div class="col1 col3"><span class="w" data-bind='text: StateId'></span></div>
            <div class="col1 col4"><span class="w" data-bind="text: Ordered"></span></div>
            <div class="col1 col5"><span class="w" data-bind="text: DateCreated"></span></div>
            <div class="col1 col6 centeralign"><span class="w">
                <input type="checkbox" name="active" disabled="disabled" data-bind="checked: Active" />
            </span></div>
		    <div class="col1 col12 centeralign">
                <span class="w">
                    <a class="btn btn-x delete" data-bind='attr: {href: "#cfmDelete", id: "district" + ID, rel: Name, onclick: "DeleteDialog(" + ID + ")"}'>Delete</a>
                </span>
            </div>
	    </div>
    </div>
</div>
@Html.Partial("_PopupConfirmDeleted")
<script type="text/javascript">
    var data = @(Html.Raw(Json.Encode(Model)));
</script>
<script src="/Scripts/ViewModel/districtgrid.js" type="text/javascript"></script>

